﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;

namespace OA.DAL
{
    public class ManagerToRole : Base<Model.ManagerToRole>
    {
        public ManagerToRole(ISession isession)
            : base(isession)
        {
            
        }

        public Model.ManagerToRole Get(string userName, string roleCode)
        {
            Model.ManagerToRole ret = null;
            var list = Get("UserName=? and RoleCode=?", null, 0, 0, userName, roleCode);
            if (list.Count > 0)
            {
                ret = list[0];
            }
            return ret;
        }
    }
}
